<div class="menu">
	<div class="head">Menu</div>
	<?php
	//echo Yii::app()->controller->id;
	$controllerId = strtolower(Yii::app()->controller->id);
	$actionId = strtolower(Yii::app()->controller->action->id);
	$this->widget('zii.widgets.CMenu', array(
			'items'=>array(
					array(	'label'=>'Home',
							'url'=>array('/'),
							'active'=>Yii::app()->controller->id == '',
							'visible'=>!UserLoginUtil::isLogin(),
					),
					array(	'label'=>'Home',
							'url'=>array('admin/'),
							'active'=>$controllerId == 'admin',
							'visible'=>UserLoginUtil::hasPermission(array("FULL_ADMIN",
									"CREATE_USER",
									"DELETE_USER",
									"UPDATE_USER",
									"VIEW_USER",
									"CREATE_ROLE",
									"DELETE_ROLE",
									"UPDATE_ROLE",
									"VIEW_ROLE",
									"CREATE_EQUIPMENT_TYPE",
									"DELETE_EQUIPMENT_TYPE",
									"UPDATE_EQUIPMENT_TYPE",
									"VIEW_EQUIPMENT_TYPE",
									"CREATE_EQUIPMENT",
									"DELETE_EQUIPMENT",
									"UPDATE_EQUIPMENT",
									"VIEW_EQUIPMENT",
									"CREATE_DEPARTMENT",
									"DELETE_DEPARTMENT",
									"UPDATE_DEPARTMENT",
									"VIEW_DEPARTMENT",
									"CREATE_ROOM",
									"DELETE_ROOM",
									"UPDATE_ROOM",
									"VIEW_ROOM",
									"CREATE_POSITION",
									"DELETE_POSITION",
									"UPDATE_POSITION",
									"VIEW_POSITION",
									"CREATE_PRESEN_TYPE",
									"DELETE_PRESENT_TYPE",
									"UPDATE_PRESENT_TYPE",
									"VIEW_PRESENT_TYPE",
									"CREATE_SERVICE_TYPE",
									"DELETE_SERVICE_TYPE",
									"UPDATE_SERVICE_TYPE",
									"VIEW_SERVICE_TYPE",
									"CREATE_SERVICE_TYPE_ITEM",
									"DELETE_SERVICE_TYPE_ITEM",
									"UPDATE_SERVICE_TYPE)ITEM",
									"VIEW_SERVICE_TYPE_ITEM",
									"CREATE_SEMESTER",
									"DELETE_SEMESTER",
									"UPDATE_SEMESTER",
									"VIEW_SEMESTER",)),
					),
					array(	'label'=>'Confirm User',
							'url'=>array('ConfirmUser/'),
							'active'=>$controllerId == 'confirmuser',
							'visible'=>UserLoginUtil::hasPermission(array("FULL_ADMIN", "CONFIRM_USER")),
					),
					array(	'label'=>'User',
							'url'=>array('User/'),
							'active'=>$controllerId == 'user' && $actionId!='staff' && $actionId != 'assignroom',
							'visible'=>UserLoginUtil::hasPermission(array("FULL_ADMIN", "VIEW_USER", "UPDATE_USER", "CREATE_USER", "DELETE_USER")),
					),
					array(	'label'=>'Assign Room for Staff',
							'url'=>array('User/Staff'),
							'active'=>$controllerId == 'user' && ($actionId == 'staff' || $actionId == 'assignroom'),
							'visible'=>UserLoginUtil::hasPermission(array("FULL_ADMIN")),
					),
					array(	'label'=>'Master Data',
							'url'=>'javascript:void(0)',
							'visible'=>UserLoginUtil::hasPermission(array(
									"FULL_ADMIN",
									"CREATE_ROLE",
									"DELETE_ROLE",
									"UPDATE_ROLE",
									"VIEW_ROLE",
									"CREATE_EQUIPMENT_TYPE",
									"DELETE_EQUIPMENT_TYPE",
									"UPDATE_EQUIPMENT_TYPE",
									"VIEW_EQUIPMENT_TYPE",
									"CREATE_EQUIPMENT",
									"DELETE_EQUIPMENT",
									"UPDATE_EQUIPMENT",
									"VIEW_EQUIPMENT",
									"CREATE_DEPARTMENT",
									"DELETE_DEPARTMENT",
									"UPDATE_DEPARTMENT",
									"VIEW_DEPARTMENT",
									"CREATE_ROOM",
									"DELETE_ROOM",
									"UPDATE_ROOM",
									"VIEW_ROOM",
									"CREATE_POSITION",
									"DELETE_POSITION",
									"UPDATE_POSITION",
									"VIEW_POSITION",
									"CREATE_PRESEN_TYPE",
									"DELETE_PRESENT_TYPE",
									"UPDATE_PRESENT_TYPE",
									"VIEW_PRESENT_TYPE",
									"CREATE_SERVICE_TYPE",
									"DELETE_SERVICE_TYPE",
									"UPDATE_SERVICE_TYPE",
									"VIEW_SERVICE_TYPE",
									"CREATE_SERVICE_TYPE_ITEM",
									"DELETE_SERVICE_TYPE_ITEM",
									"UPDATE_SERVICE_TYPE)ITEM",
									"VIEW_SERVICE_TYPE_ITEM",
									"CREATE_SEMESTER",
									"DELETE_SEMESTER",
									"UPDATE_SEMESTER",
									"VIEW_SEMESTER",)),
							'active'=>($controllerId== 'equipmenttype') || ($controllerId== 'role') || ($controllerId== 'equipment') || ($controllerId== 'department') || ($controllerId== 'room') || ($controllerId== 'semester'),
							'items'=>array(
									array(	'label'=>'Role',
											'url'=>array('Role/'),
											'active'=>$controllerId == 'role',
											'visible'=>UserLoginUtil::hasPermission(array("FULL_ADMIN", "VIEW_ROLE", "UPDATE_ROLE", "CREATE_ROLE", "DELETE_ROLE")),
									),
									array(	'label'=>'Equipment Type',
											'url'=>array('EquipmentType/'),
											'active'=>$controllerId == 'equipmenttype',
											'visible'=>UserLoginUtil::hasPermission(array("FULL_ADMIN", "VIEW_EQUIPMENT_TYPE", "UPDATE_EQUIPMENT_TYPE", "CREATE_EQUIPMENT_TYPE", "DELETE_EQUIPMENT_TYPE")),
									),
									array(	'label'=>'Equipment',
											'url'=>array('Equipment/'),
											'active'=>$controllerId == 'equipment',
											'visible'=>UserLoginUtil::hasPermission(array("FULL_ADMIN", "VIEW_EQUIPMENT", "UPDATE_EQUIPMENT", "CREATE_EQUIPMENT", "DELETE_EQUIPMENT")),
									),
									array(	'label'=>'Department',
											'url'=>array('Department/'),
											'active'=>$controllerId == 'department',
											'visible'=>UserLoginUtil::hasPermission(array("FULL_ADMIN", "VIEW_DEPARTMENT", "UPDATE_DEPARTMENT", "CREATE_DEPARTMENT", "DELETE_DEPARTMENT")),
									),
									array(	'label'=>'Room',
											'url'=>array('Room/'),
											'active'=>$controllerId == 'room',
											'visible'=>UserLoginUtil::hasPermission(array("FULL_ADMIN", "VIEW_ROOM", "UPDATE_ROOM", "CREATE_ROOM", "DELETE_ROOM")),
									),
									array(	'label'=>'Semester',
											'url'=>array('Semester/'),
											'active'=>$controllerId == 'semester',
											'visible'=>UserLoginUtil::hasPermission(array("FULL_ADMIN", "VIEW_SEMESTER", "UPDATE_SEMESTER", "CREATE_SEMESTER", "DELETE_SEMESTER")),
									),
									array(	'label'=>'Position',
											'url'=>array('Position/'),
											'active'=>$controllerId == 'position',
											'visible'=>UserLoginUtil::hasPermission(array("FULL_ADMIN", "VIEW_POSITION", "UPDATE_POSITION", "CREATE_POSITION", "DELETE_POSITION")),
									),
									array(	'label'=>'Present Type',
											'url'=>array('PresentType/'),
											'active'=>$controllerId == 'presenttype',
											'visible'=>UserLoginUtil::hasPermission(array("FULL_ADMIN", "VIEW_PRESENT_TYPE", "UPDATE_PRESENT_TYPE", "CREATE_PRESENT_TYPE", "DELETE_PRESENT_TYPE")),
									),
									array(	'label'=>'Service Type',
											'url'=>array('ServiceType/'),
											'active'=>$controllerId == 'servicetype',
											'visible'=>UserLoginUtil::hasPermission(array("FULL_ADMIN", "VIEW_SERVICE_TYPE", "UPDATE_SERVICE_TYPE", "CREATE_SERVICE_TYPE", "DELETE_SERVICE_TYPE")),
									),
									array(	'label'=>'Service Type Item',
											'url'=>array('ServiceTypeItem/'),
											'active'=>$controllerId == 'servicetypeitem',
											'visible'=>UserLoginUtil::hasPermission(array("FULL_ADMIN", "VIEW_SERVICE_TYPE_ITEM", "UPDATE_SERVICE_TYPE_ITEM", "CREATE_SERVICE_TYPE_ITEM", "DELETE_SERVICE_TYPE_ITEM")),
									),
									array(	'label'=>'Period Group',
											'url'=>array('PeriodGroup/'),
											'active'=>$controllerId == 'periodgroup',
											'visible'=>UserLoginUtil::hasPermission(array("FULL_ADMIN")),
									),
									array(	'label'=>'Period',
											'url'=>array('Period/'),
											'active'=>$controllerId == 'period',
											'visible'=>UserLoginUtil::hasPermission(array("FULL_ADMIN")),
									),
									array(	'label'=>'Approver',
											'url'=>array('Approver/'),
											'active'=>$controllerId == 'approver',
											'visible'=>UserLoginUtil::hasPermission(array("FULL_ADMIN")),
									),									
							)),
					array(	'label'=>'CMS',
							'url'=>'javascript:void(0)',
							'visible'=>UserLoginUtil::hasPermission(array(
									"FULL_ADMIN",
									"VIEW_NEWS",
									"UPDATE_NEWS",
									"CREATE_NEWS",
									"DELETE_NEWS",
									"VIEW_GALLERY",
									"UPDATE_GALLERY",
									"CREATE_GALLERY",
									"DELETE_GALLERY",
									"VIEW_SOCIAL_MEDIA",
									"UPDATE_SOCIAL_MEDIA",
									"CREATE_SOCIAL_MEDIA",
									"DELETE_SOCIAL_MEDIA",
									"VIEW_LINK",
									"UPDATE_LINK",
									"CREATE_LINK",
									"DELETE_LINK",
									)),
							'active'=>($controllerId== 'news') || ($controllerId== 'gallery') || ($controllerId== 'socialmedia') || ($controllerId== 'link'),
							'items'=>array(
									array(	'label'=>'ED-Tech News',
											'url'=>array('News/'),
											'active'=>$controllerId == 'news',
											'visible'=>UserLoginUtil::hasPermission(array("FULL_ADMIN", "VIEW_NEWS", "UPDATE_NEWS", "CREATE_NEWS", "DELETE_NEWS")),
									),
// 									array(	'label'=>'Gallery',
// 											'url'=>array('Gallery/'),
// 											'active'=>$controllerId == 'gallery',
// 											'visible'=>UserLoginUtil::hasPermission(array("FULL_ADMIN", "VIEW_GALLERY", "UPDATE_GALLERY", "CREATE_GALLERY", "DELETE_GALLERY")),
// 									),
// 									array(	'label'=>'SocialMedia',
// 											'url'=>array('SocialMedia/'),
// 											'active'=>$controllerId == 'socialmedia',
// 											'visible'=>UserLoginUtil::hasPermission(array("FULL_ADMIN", "VIEW_SOCIAL_MEDIA", "UPDATE_SOCIAL_MEDIA", "CREATE_SOCIAL_MEDIA", "DELETE_SOCIAL_MEDIA")),
// 									),
									array(	'label'=>'R2R',
											'url'=>array('Link/'),
											'active'=>$controllerId == 'link',
											'visible'=>UserLoginUtil::hasPermission(array("FULL_ADMIN", "VIEW_LINK", "UPDATE_LINK", "CREATE_LINK", "DELETE_LINK")),
									),
							)),
					array(	'label'=>'Login',
							'url'=>array('management/Login'),
							'visible'=>!UserLoginUtil::isLogin(),
					),
			),
	));

	?>
</div>
